import {createStore} from 'vuex'

// import persistedState from 'vuex-persistedstate'
import createPersistedState from 'vuex-persistedstate';

const actions={

}
const mutations={
    jia(state,value){
        state.test+=value
    },
    UpLoginState(state,value){
        state.LoginState=value
    },
    updateTeacherName(state,value){
        state.teachername=value
    },
    updateAdminName(state,value){
        state.adminname=value
    },
    updateUploadName(state,value){
        state.uploadName=value
    }
}
const state={
    test:0,
    PageState:'首页',
    LaberPageSate:'首页',
    LaberState:false,
    LoginState:false,
    teachername:'未知',
    adminname:'未知',
    uploadName:'未知'
}
const modules={

}
export default createStore({
    actions,
    mutations,
    state,
    plugins: [
        createPersistedState({
          storage: window.sessionStorage, // 存储方式，可以是localStorage或sessionStorage
        }),
      ],
    modules,
})